package main

import "fmt"

//1、深度拷贝: copy(sliceA, sliceB),指针指向的数组内容而不是指针值进行拷贝
//2、浅拷贝: sliceA = sliceB2,数组指针指向的是同一个地址
func main() {
	var s1 = []int{1, 2}
	var s2 = make([]int, 2)

	copy(s2, s1) //深度拷贝
	s2[0] = 99

	fmt.Println(s1) //[1 2]
	fmt.Println(s2) //[99 2]
}
